<script setup>
import { useStore } from 'vuex'
const store = useStore() // store====this.$store
// js :store.state.username
// html:是可以使用$store
console.log('用户名', store.state.username)
</script>
<template>
  <div>
    <h3>用户名:{{ $store.state.username }}</h3>
    <ul>
      <li>
        <router-link to="/">首页</router-link>
      </li>
      <li>
        <router-link to="/login">登陆</router-link>
      </li>
    </ul>
    <router-view></router-view>
  </div>
</template>
<style></style>
